package com.shensi.adminCollect.service.customer;

import com.shensi.common.core.domain.AjaxResult;
import com.shensi.adminCollect.domain.customer.CustomerCardUseRecord;
import com.shensi.adminCollect.domain.customer.CustomerElectronicCard;
import com.shensi.adminCollect.domain.customer.ElecSumInfo;
import com.shensi.adminCollect.domain.customer.dto.CustomerCardChangeDto;
import com.shensi.adminCollect.domain.customer.from.UserBalanceForm;
import com.shensi.adminCollect.domain.customer.vo.Integral;
import com.shensi.adminCollect.domain.customer.vo.UserBalanceSumVO;
import com.shensi.adminCollect.domain.customer.vo.UserBalanceVO;
import com.shensi.adminCollect.vo.customer.ElectronicCardListVO;

import java.math.BigDecimal;
import java.util.List;

/**
 * 客户电子会员卡（储蓄卡）Service接口
 * 
 * @author qujia
 * @date 2021-04-12
 */
public interface ICustomerElectronicCardService 
{
    /**
     * 查询客户电子会员卡（储蓄卡）
     * 
     * @param id 客户电子会员卡（储蓄卡）ID
     * @return 客户电子会员卡（储蓄卡）
     */
    public CustomerElectronicCard selectCustomerElectronicCardById(Long id);

    public CustomerElectronicCard selectCustomerElectronicCard(Long id);

    /**
     * 查询客户电子会员卡（储蓄卡）列表
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 客户电子会员卡（储蓄卡）集合
     */
    public List<CustomerElectronicCard> selectCustomerElectronicCardList(CustomerElectronicCard customerElectronicCard);

    /**
     * 新增客户电子会员卡（储蓄卡）
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 结果
     */
    public int insertCustomerElectronicCard(CustomerElectronicCard customerElectronicCard);

    /**
     * 修改客户电子会员卡（储蓄卡）
     * 
     * @param customerElectronicCard 客户电子会员卡（储蓄卡）
     * @return 结果
     */
    public int updateCustomerElectronicCard(CustomerElectronicCard customerElectronicCard);

    public AjaxResult updateUserReocrd(CustomerCardChangeDto customerCardChangeDto);

    /**
     * 批量删除客户电子会员卡（储蓄卡）
     * 
     * @param ids 需要删除的客户电子会员卡（储蓄卡）ID
     * @return 结果
     */
    public int deleteCustomerElectronicCardByIds(Long[] ids);

    /**
     * 删除客户电子会员卡（储蓄卡）信息
     * 
     * @param id 客户电子会员卡（储蓄卡）ID
     * @return 结果
     */
    public int deleteCustomerElectronicCardById(Long id);

    /**
     * 查询电子会员数据
     */
    public CustomerElectronicCard listSum(CustomerElectronicCard customerElectronicCard);
    /**
     * 查询电子会员报表数据
     */
    public List<CustomerElectronicCard> selectCard(CustomerElectronicCard customerElectronicCard);

    public List<CustomerElectronicCard> selectCardPage(CustomerElectronicCard customerElectronicCard);

    public CustomerElectronicCard listHYData(CustomerElectronicCard customerElectronicCard);

    public CustomerElectronicCard listJRHYData(CustomerElectronicCard customerElectronicCard);

    /**
     * 查询电子卡的汇总信息
     */
    public List<CustomerElectronicCard> cardUserSum(CustomerElectronicCard customerElectronicCard);

    List<ElecSumInfo> getRechargeSum(CustomerCardUseRecord customerCardUseRecord);

    List<ElecSumInfo> getManualDeduction(CustomerCardUseRecord customerCardUseRecord);

    List<ElecSumInfo> getConsumeSum(CustomerCardUseRecord customerCardUseRecord);


    List<ElecSumInfo> getBalanceSum(CustomerElectronicCard customerElectronicCard,boolean cardUseForAll);

    List<CustomerElectronicCard> getCustomerElectronicCardListForEnterprise(String mobilePhone, String[] cardTypes, Long enterpriseId);
    List<CustomerElectronicCard> getCustomerElectronicCardListForStation(String mobilePhone, String[] cardTypes, Long stationId);

    ElectronicCardListVO queryCustomerCardList(String mobilePhone, Long enterpriseId);


    int incrCustomerElectronicCardBalance(BigDecimal incrAmt,BigDecimal incrPresentAmt,CustomerElectronicCard card);

    int insertBatch(List<CustomerElectronicCard> cardList);

    BigDecimal getCustomerElectronicCardBalance(String mobilePhone, Integer enterpriseId, boolean cardUseForAll, List<String> types);

    CustomerElectronicCard getElectronicCardInfo(CustomerElectronicCard customerElectronicCard);

    
    List<CustomerElectronicCard> queryListOrderByCardType(CustomerElectronicCard customerElectronicCard);

    CustomerElectronicCard getCustomerElectronicCard(String mobilePhone, String cardType, Long stationId,Long enterpriseId) ;

    List<UserBalanceVO> queryUserBalanceVOList(UserBalanceForm form);

    UserBalanceSumVO sumUserBalanceVO(UserBalanceForm form);



    Integral rechargeActivityGiveIntegral(String orderNo);

    Integral rechargeActivityGiveIntegral(CustomerCardUseRecord customerCardUseRecord);

}
